<template>
  <div class="data-status">
    <div class="updating-dot"></div>
    <span>数据更新中...</span>
    <div class="fullscreen-btn" @click="toggleFullscreen">
      <i class="el-icon-full-screen"></i>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DataStatus',
  methods: {
    toggleFullscreen() {
      this.$emit('toggle-fullscreen');
    }
  }
}
</script>

<style lang="scss" scoped>
.data-status {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 8px 15px;
  background: rgba(0, 0, 0, 0.3);
  color: #8f9bb3;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
  z-index: 1000;

  .updating-dot {
    width: 8px;
    height: 8px;
    background: #00a0e9;
    border-radius: 50%;
    animation: pulse 1s infinite;
  }

  .fullscreen-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #8f9bb3;
    background: rgba(3, 12, 49, 0.6);
    border: 1px solid rgba(28, 89, 156, 0.3);
    border-radius: 10px;
    margin-left: 12px;
    transition: all 0.3s ease;

    &:hover {
      color: #fff;
      background: rgba(0, 120, 255, 0.2);
      transform: scale(1.05);
    }

    i {
      font-size: 18px;
    }
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
  }

  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
}
</style>
